<style>
    #unit {
        display: inline-block;
        height: 31px;
        line-height: 31px;
    }
</style>

<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label for="level" class="control-label col-xs-12 col-sm-2">{:__('level')}:</label>
        <div class="col-xs-12 col-sm-4">
            <select name="row[level]" class="form-control" disabled>
                {volist name="orelvs" id="lv"}
                    <option value="{$key}" {if $key == $row['level']}selected{/if}>{$lv}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="orecode" class="control-label col-xs-12 col-sm-2">{:__('orecode')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input readonly id="orecode" data-rule="required" class="form-control" placeholder="请输入{:__(config('site.ore_text'))}编号(必填)" name="row[orecode]" type="text" value="{$row['orecode']}">
        </div>
    </div>

    <div class="form-group">
        <label for="price" class="control-label col-xs-12 col-sm-2">{:__('price')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input readonly id="price" data-rule="required" min="0" class="form-control" name="row[price]" type="number" value="{$row['price']}" onblur="nissanFunc()">
        </div>
    </div>

    <!-- <div class="form-group">
         <label for="num" class="control-label col-xs-12 col-sm-2">{:__('num')}:</label>
         <div class="col-xs-12 col-sm-4">
             <input id="num" data-rule="required" min="0" class="form-control" name="row[num]" type="number" value="" onblur="nissanFunc()">
         </div>
     </div>-->
    <div class="form-group">
        <label for="ap_username" class="control-label col-xs-12 col-sm-2">{:__('归属用户编号')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input readonly id="ap_username" data-rule="" min="0" class="form-control" placeholder="归属用户编号" name="row[ap_username]" type="text" value="{$row['ap_username']}" >
        </div>
    </div>
    <div class="form-group">
        <label for="ap_username" class="control-label col-xs-12 col-sm-2">{:__('归属用户订单号')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input readonly id="ap_ordersn" data-rule="" min="0" class="form-control" placeholder="归属用户订单号" name="row[ap_ordersn]" type="text" value="{$row['ap_ordersn']}" >
        </div>
    </div>
    <div class="form-group">
        <label for="username" class="control-label col-xs-12 col-sm-2">{:__('username')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="username" data-rule="" min="0" class="form-control" placeholder="请输入用户编号(非必填)" name="row[username]" type="text" value="{$row['username']}" >
        </div>
    </div>


    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('status')}:</label>
        <div class="col-xs-12 col-sm-7">
            {:build_radios('row[status]', ['1'=>__('open'), '0'=>__('close'),'2'=>__('已失效')],$row['status'])}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__(config('site.ore_text').'的状态')}:</label>
        <div class="col-xs-12 col-sm-7">
            {:build_radios('row[status2]', ['0'=>__(config('site.booking_text')), '1'=>__(config('site.mine_grab_text')), '2'=>__(config('site.mining_text'))],$row['status2'])}
        </div>
    </div>



    <div class="form-group">
        <label for="" class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed">{:__('Submit')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>

<script>
    function nissanFunc() {
        var power = document.getElementById('power');
        var price = document.getElementById('price');
        var nissan = document.getElementById('nissan');

        nissan.value = (power.value * price.value * 0.01).toFixed(3);
    }
</script>